import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryGeneratedColumn,
} from 'typeorm';

@Entity('tb_faq', {
  comment: '常见问题表',
})
export class Faq {
  @PrimaryGeneratedColumn('increment', { comment: '自增主键', unsigned: true })
  id: number;

  @Column({ comment: '问题' })
  question: string;

  @Column({ comment: '答案' })
  answer: string;

  @Column({ comment: '是否显示', type: 'tinyint', default: true })
  display: boolean;

  @Column({ comment: '有用', unsigned: true, default: 0 })
  useful: number;

  @Column({ comment: '无用', unsigned: true, default: 0 })
  useless: number;

  @CreateDateColumn({ comment: '创建时间' })
  created: Date;
}
